﻿using Microsoft.AspNetCore.Mvc;
using PHMEE.DTOS.StatusMonitor;
using PHMEE.IServices.StatusMonitor;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PHMEE.Controllers.StatusMonitor
{
    /// <summary>
    /// 船舶状态监测🚢🌞🌛✨
    /// </summary>
    [Route("api/vesselstatusmonitor")]
    public class VesselStatusMonitorController : PHMEEController
    {
        private readonly IVesselStatusMonitorAppService vesselStatusMonitorAppService;

        public VesselStatusMonitorController(IVesselStatusMonitorAppService vesselStatusMonitorAppService)
        {
            this.vesselStatusMonitorAppService = vesselStatusMonitorAppService;
        }


        /// <summary>
        /// 船舶-获取船舶参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselMainParams")]
        public async Task<VesselMainModel> GetVesselMainParams(Guid VesselId)
        {
            return await vesselStatusMonitorAppService.GetVesselMainParams(VesselId);
        }


        /// <summary>
        /// 船舶-获取航行参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselNavigationParams")]
        public async Task<VesselNavigationModel> GetVesselNavigationParams(Guid VesselId, VesselBaseInput input)
        {
            return await vesselStatusMonitorAppService.GetVesselNavigationParams(VesselId, input);
        }


        /// <summary>
        /// 船舶-获取GPS参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="OnVessel"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselGpsParams")]
        public async Task<VesselGpsModel> GetVesselGpsParams(Guid VesselId, bool OnVessel, VesselBaseInput input)
        {
            return await vesselStatusMonitorAppService.GetVesselGpsParams(VesselId, OnVessel, input);
        }

        /// <summary>
        /// 船舶-获取Draft参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="OnVessel"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselDraftParams")]
        public async Task<VesselDraftModel> GetVesselDraftParams(Guid VesselId, bool OnVessel, VesselBaseInput input)
        {
            return await vesselStatusMonitorAppService.GetVesselDraftParams(VesselId, OnVessel, input);
        }

        /// <summary>
        /// 船舶-获取MainEngine参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="OnVessel"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselMainEngineParams")]
        public async Task<VesselMainEngineModel> GetVesselMainEngineParams(Guid VesselId, bool OnVessel, VesselBaseInput input)
        {
            return await vesselStatusMonitorAppService.GetVesselMainEngineParams(VesselId, OnVessel, input);
        }

        /// <summary>
        /// 船舶-获取ShaftSystem参数相关信息
        /// </summary>
        /// <param name="VesselId"></param>
        /// <param name="OnVessel"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetVesselShaftSystemParams")]
        public async Task<VesselShaftSystemModel> GetVesselShaftSystemParams(Guid VesselId, bool OnVessel, VesselBaseInput input)
        {
            return await vesselStatusMonitorAppService.GetVesselShaftSystemParams(VesselId, OnVessel, input);
        }

        /// <summary>
        /// 获取当前天气
        /// </summary>
        /// <param name="vesselId"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("GetCurrentWeather")]
        public async Task<CurrentWeatherDto> GetCurrentWeatherAsync(Guid vesselId)
        {
            return await vesselStatusMonitorAppService.GetCurrentWeatherAsync(vesselId);
        }

    }
}
